#include <iostream>
#include <cmath>
using namespace std;

int fac(int x)
{
    int result = 1;
    for (int i = 1; i <= x; i++)
    {
        result *= i;
    }
    return result;
}

float mysin(float x)
{
    float maxNum = 12, result = x;
    for (int i = 1 + 2; i <= maxNum; i += 2)
    {
        result -= pow(x, i) / fac(i);
        i += 2;
        result += pow(x, i) / fac(i);
    }
    return result;
}

int main()
{
    cout << "学号：3170608043，姓名：石英钰\n";
    float x;
    cout << "Please input a number x to compute sin(x): ";
    cin >> x;
    printf("sin(%f)≈%f\n", x, mysin(x));
}